Skip to content

Instantly share code, notes, and snippets.

@crazygit
crazygit / parseTransaction.go
Last active May 9, 2024 13:22
Parse Ethereum Transaction, Decode input data, Decode output data
package main
import (
"context"
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
@akshaybabloo
akshaybabloo / get_dns_records.py
Last active May 9, 2024 13:22
Printing all DNS records using DNSPython in Python 3
#!/usr/bin/env python
# -*- coding utf-8 -*-
#
# Copyright 2016 Akshay Raj Gollahalli
import dns.resolver
def get_records(domain):
"""
@ugnb
ugnb / boto3_digitalocean.py
Last active May 9, 2024 13:21
Using Python boto3 with DigitalOcean object storage
import logging
import urllib.request
import boto3
from settings import OBJECT_STORAGE_KEY, OBJECT_STORAGE_SECRET, OBJECT_STORAGE_REGION, OBJECT_STORAGE_BUCKET
logger = logging.getLogger(__name__)
s3config = {
"region_name": OBJECT_STORAGE_REGION,
"endpoint_url": "https://{}.digitaloceanspaces.com".format(OBJECT_STORAGE_REGION),
@cassidoo
cassidoo / mergerefs.jsx
Created January 10, 2023 22:57
Merge refs in React so a component can have more than one ref
export function mergeRefs(refs) {
return (value) => {
refs.forEach((ref) => {
if (typeof ref === "function") {
ref(value);
} else if (ref != null) {
ref.current = value;
}
});
};
@nafiesl
nafiesl / how_to_get_telegram_chat_id.md
Created December 20, 2023 11:49
How to get Telegram Bot Chat ID

How to get Telegram Bot Chat ID

Create a Telegram Bot and get a Bot Token

  1. Open Telegram application then search for @BotFather
  2. Click Start
  3. Click Menu -> /newbot or type /newbot and hit Send
  4. Follow the instruction until we get message like so
    Done! Congratulations on your new bot. You will find it at t.me/new_bot.
    
@matperez
matperez / 1632823990.json
Last active May 9, 2024 13:18
Karabiner elements Russian layout
{
"title": "For Russian",
"rules": [
{
"description": "Заменить / в русской раскладке на точку",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
@trisberg
trisberg / local-registry.md
Last active May 9, 2024 13:17
Using a Local Registry with Minikube

Using a Local Registry with Minikube

Install a local Registry

These instructions include running a local registry accessible from Kubernetes as well as from the host development machine at registry.dev.svc.cluster.local:5000.

  1. Use the docker CLI to run the registry:2 container from Docker, listening on port 5000, and persisting images in the ~/.registry/storage directory.
@jasongaylord
jasongaylord / beacon.html
Created August 27, 2020 18:36
Beacon CSS - An example using CSS animations to create a beacon for use on something like a map or to call attention visually.
<!DOCTYPE HTML>
<html lang="en">
<head>
<style>
.dot {
background-color: red;
border-radius: 50%;
width: 20px;
height: 20px;
display: block;
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@DraTeots
DraTeots / ComPort over Network.md
Last active May 9, 2024 13:07
ComPort over Network